﻿using System;
using System.IO;

namespace SBPweb.MediaCenter.Modules.Downloader.Torrent
{

    internal class TorrentFile : MonoTorrent.Common.TorrentFile, ITorrentFile
    {

        #region Constructor logic

        internal TorrentFile(Uri uri)
            : this(uri.OriginalString)
        {
        }

        internal TorrentFile(Uri uri, long length)
            : this(uri.OriginalString, length)
        {
        }

        internal TorrentFile(Uri uri, long length, int priority)
            : this(uri.OriginalString, length, priority)
        {
        }

        internal TorrentFile(string path)
            : this(path, new FileInfo(path).Length, 4)
        {
        }

        internal TorrentFile(string path, long length)
            : this(path, length, 4)
        {
        }

        internal TorrentFile(string path, long length, int priority)
            : base(path, length, (MonoTorrent.Common.Priority)priority)
        {
        }

        #endregion

        #region Property accessors

        public int PriorityAsInt
        {
            get
            {
                return (int)base.Priority;
            }
            set
            {
                base.Priority = (MonoTorrent.Common.Priority)value;
            }
        }

        #endregion

    }

}